package com.mes.basicdata.controller;

import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

@RestController
@RequestMapping(value="",produces=MediaType.APPLICATION_JSON_VALUE)
@Api(value="SpringMVC测试API")
public class SpringTest{
	
	@ResponseBody
	@RequestMapping(value="/hello.do",produces=MediaType.APPLICATION_JSON_VALUE,method=RequestMethod.GET)
	@ApiOperation(value="sayHello",notes="测试hello函数")
	public ResponseEntity<String> hello(
			@ApiParam(name="msg",value="招呼内容",defaultValue="world") @RequestParam String msg) {
		System.out.println(msg);
		return new ResponseEntity<String>("hello" + msg, HttpStatus.OK);
	}
	
}
